package com.owl.app;

import java.util.Timer;
import java.util.TimerTask;

import android.app.Application;
import android.app.ProgressDialog;
import android.content.Context;
import android.util.Log;

public class Owllab extends Application {
	
	private String companyMapState;
	private static final String TAG = "Owllab";
	public ProgressDialog loadingDialog;

	public String getCompanyMapState() {
		return companyMapState;
	}

	public void setCompanyMapState(String s) {
		companyMapState = s;
	}
	
	public void startLoading(Context ctx){
		loadingDialog = ProgressDialog.show(ctx, "Loading...", "Please wait...", true, true);
		Log.v(TAG, "startLoading" + ctx.toString());
	}
	
	public void endLoading(){
		Log.v(TAG, "endLoading");
		EndLoader endLoader = new EndLoader();
		Timer timer = new Timer(false);
		timer.schedule(endLoader, 1000);
	}
	
	class EndLoader extends TimerTask{
		EndLoader(){}
		public void run(){
			loadingDialog.dismiss();
		}
	}
}
